<template>
	<u-read-more ref="uReadMore" :showHeight="200" closeText="查看更多" :toggle="true">
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">钢丝绳编码</text>
			</u-col>
			<u-col span="8">
				<DataSelect v-if="type=='usingWirerope'" class="w-100" :disabled="!isEdit" @onChange="codeChange('old')"
					table="UsingWirerope" action="GetSearchs" :filter="{_Status:1}" label="name"
					value="autoID" :obj.sync="codeObj" :id.sync="oldData.code" :name.sync="oldData.code">
				</DataSelect>
				<DataSelect v-else class="w-100" :disabled="!isEdit" @onChange="codeChange('old')"
					table="Stock" action="GetSearchs" :filter="{_isOut:false}" label="name"
					value="autoID" :obj.sync="codeObj" :id.sync="oldData.code" :name.sync="oldData.code">
				</DataSelect>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">钢丝绳名称</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.name}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">规格型号</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.guiGe}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">直径</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.diameter}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">公称捻距</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.nianJu}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">长度</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.lengthNum}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">安装长度</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.installLengthNum}}</text>
			</u-col>
		</u-row>
	
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">绳子条数</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.cnt}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">提升用途</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.hoisterUsageName}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">提升机类型</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.hoisterName}}</text>
			</u-col>
		</u-row>
	
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">提升机用途</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.hoisterUsageName}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">钢丝绳类型</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.wireropeTypeName}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">安装日期</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.installDate | ymd}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">主要负责人</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.linkUser}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">负责人电话</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.linkPhone}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">矿山</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.department_Name}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">备注</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.remark}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">供应商</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.supplierName}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">制造商</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.producerName}}</text>
			</u-col>
		</u-row>
	
	
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">抗拉强度</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.mpaName}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">表面状态</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.surfaceStatusName}}</text>
			</u-col>
		</u-row>
		<u-line class="marb-20"></u-line>
		<u-row gutter="0" class="marb-20">
			<u-col span="4" textAlign="center">
				<text class="label-name">捻制类型</text>
			</u-col>
			<u-col span="6">
				<text class="label-name">{{oldData.twistingTypeName}}</text>
			</u-col>
		</u-row>
	
	
	</u-read-more>
</template>

<script>
import { object } from '@dcloudio/vue-cli-plugin-uni/packages/postcss/tags';
	export default {
		data() {
			return {
				codeObj:{},
				oldData:{}
			}
		},
		props: {
			isEdit:{
				type:Boolean,
				default:true
			},
			type:{
				type:String,
				default:'usingWirerope'
			},
		},
		methods: {
			init(data){
				if(Object.keys(data).length){
					this.codeObj=data;
					this.oldData=data;
				}
			},
			codeChange(type) {
				let codeObj = this.codeObj;
				this.$emit('ropeChange',this.$_.cloneDeep(codeObj));
				if (Object.keys(codeObj).length < 1) {
					this.setRopeData('');
					return;
				}
				this.setRopeData(codeObj);
			},
			setRopeData(data) {
				let hasCol = ['code', 'stockID', 'name', 'guiGe', 'diameter', 'nianJu', 'lengthNum', 'cnt', 'mpaID',
					'mpaName', 'surfaceStatusID', 'surfaceStatusName', 'twistingTypeID', 'twistingTypeName',
					'departmentID', 'departmentName', 'installAddressID', 'installAddressName', 'hoisterID',
					'hoisterName', 'hoisterUsageID', 'hoisterUsageName', 'wireropeTypeID', 'wireropeTypeName', 'remark'
				];
				hasCol.map((x) => {
					if (data == '') {
						this.$set(this.oldData, x, '');
					} else {
						this.$set(this.oldData, x, data[x]);
					}
				})
			},
			getData(){
				return this.codeObj;
			}
		}
	}
</script>

<style>

</style>
